<template>
  <div class="syncMainIndex">
    <c-title :hide="false" text="划转"></c-title>
    <diyBackGround :minHeight="'8.5rem'">
      <div class="userBox">
        <div class="left">
          <img v-if="info.member" :src="info.member.avatar" alt="" />
        </div>
        <div class="rigth">{{ info.member.nickname }}</div>
      </div>
    </diyBackGround>
    <div class="plugInto">
      <div class="line" @click="toSyncMainPlugin('integral')" v-if="info.integral_switch">
        <div class="left">
          <i class="iconfont icon-xiaofeijifenhuazhuan"></i>
          <span>{{ info.integral_name }}划转</span>
        </div>
        <i class="iconfont icon-course_goon"></i>
      </div>
      <div class="line" @click="toSyncMainPlugin('love')" v-if="info.love_switch">
        <div class="left">
          <i class="iconfont icon-keyongaixinzhihuazhuan"></i>
          <span>{{ info.love_name }}划转</span>
        </div>
        <i class="iconfont icon-course_goon"></i>
      </div>
      <div class="line" @click="toSyncMainPlugin('point')" v-if="info.point_switch">
        <div class="left">
          <i class="iconfont icon-jifenhuazhuan"></i>
          <span>{{ info.point_name }}划转</span>
        </div>
        <i class="iconfont icon-course_goon"></i>
      </div>
    </div>
  </div>
</template>
<script>
import diyBackGround from "../member/balance/componet/diyBackGround";
export default {
  data() {
    return {
      info: {
        member: {
          avatar: "http://shop.yunzhong.com:8890/static/images/photo-mr.jpg",
          nickname: "18*******79"
        },
        love_name: "贡献值",
        point_name: "工分Y",
        integral_name: "消费补贴",
        love_switch: false,
        point_switch: true,
        integral_switch: true
      }
    };
  },
  activated() {
    this.getData();
  },
  methods: {
    toSyncMainPlugin(key) {
      this.$router.push(this.fun.getUrl("syncMainPlugin", { plugin: key }));
    },
    getData() {
      $http.get("plugin.sync-main.frontend.controllers.page.index", {}, "加载中..").then(response => {
        if (response.result == 1) {
          console.log(response.data)
          this.info = response.data;
        } else {
          this.$toast(res.msg);
        }
      });
    }
  },
  components: { diyBackGround }
};
</script>
<style lang="scss" scoped>
.userBox {
  padding: 0.88rem 1.06rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  .rigth {
    font-size: 1rem;
    line-height: 1.5rem;
    color: #ffffff;
  }
  .left {
    width: 3.44rem;
    height: 3.44rem;
    background: rgba(115, 115, 115, 0.39);
    border-radius: 50%;
    margin-right: 0.53rem;
    img {
      width: 3.44rem;
      height: 3.44rem;
      background: rgba(115, 115, 115, 0.39);
      border-radius: 50%;
    }
  }
}
.plugInto {
  display: flex;
  flex-direction: column;
  margin: -2.94rem 0.75rem 0 0.75rem;
  background: #ffffff;
  border-radius: 0.5rem;
  padding-bottom: 1.66rem;
  .line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.03rem;
    box-sizing: border-box;
    padding-top: 1.66rem;
    .left {
      flex: 1;
      display: flex;
      align-items: center;
      font-size: 0.88rem;
      .iconfont {
        font-size: 1.3rem;
        margin-right: 0.63rem;
      }
    }
    .icon-course_goon {
      flex-shrink: 0;
      font-size: 0.5rem;
    }
  }
}
</style>
